﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Light.Framework.Model;

namespace Light.Framework.Contract
{
    /// <summary>
    /// 实体接口类
    /// </summary>
    public interface IEntity
    {
        /// <summary>
        /// 唯一标识
        /// </summary>
        string ID { get; set; }

        /// <summary>
        /// 是否为新对象
        /// </summary>
        bool IsNew { get; }

        /// <summary>
        /// 是否通过验证
        /// </summary>
        bool IsValidated { get; }

        /// <summary>
        /// 未通过验证时的错误提示
        /// </summary>
        /// <returns></returns>
        string GetErrorMessage();
    }

    /// <summary>
    /// 可设置为默认项的对象
    /// </summary>
    public interface IDefaultable
    {
        /// <summary>
        /// 是否为默认项
        /// </summary>
        bool IsDefault { get; set; }
    }
}
